	.arch armv8-a
	.arch_extension crc
	.arm
	.text
	.global get_next
	.type get_next , %function
get_next:
	push {r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov fp, sp
	sub sp, sp, #16
.L95:
	str r0, [fp, #-16]
	str r1, [fp, #-12]
	ldr r10, =0
	ldr r9, =1
	sub r8, r10, r9
	ldr r4, [fp, #-12]
	mov r5, #0
	mov r6, #4
	mul r7, r5, r6
	add r5, r4, r7
	str r8, [r5]
	ldr r4, =0
	str r4, [fp, #-8]
	ldr r4, =0
	ldr r5, =1
	sub r6, r4, r5
	str r6, [fp, #-4]
	b .L101
.L101:
	ldr r4, [fp, #-16]
	ldr r5, [fp, #-8]
	cmp r5, #0
	mov r6, #4
	mul r7, r5, r6
	add r5, r4, r7
	ldr r4, [r5]
	add sp, sp, #16
	pop {r4, r5, r6, r7, r8, r9, r10, fp, lr}
	bx lr
.L102:
	ldr r4, [fp, #-4]
	cmp r4, #0
	ldr r5, =0
	ldr r6, =1
	sub r7, r5, r6
	cmp r7, #0
	cmp r4, r7
	beq .L110
	b .L124
.L103:
	add sp, sp, #16
	pop {r4, r5, r6, r7, r8, r9, r10, fp, lr}
	bx lr
.L105:
	add sp, sp, #16
	pop {r4, r5, r6, r7, r8, r9, r10, fp, lr}
	bx lr
.L106:
	add sp, sp, #16
	pop {r4, r5, r6, r7, r8, r9, r10, fp, lr}
	bx lr
.L107:
	b .L106
.L110:
	ldr r4, [fp, #-4]
	ldr r5, =1
	add r6, r4, r5
	str r6, [fp, #-4]
	ldr r4, [fp, #-8]
	ldr r5, =1
	add r6, r4, r5
	str r6, [fp, #-8]
	ldr r4, [fp, #-4]
	ldr r5, [fp, #-12]
	ldr r6, [fp, #-8]
	mov r7, #4
	mul r8, r6, r7
	add r6, r5, r8
	str r4, [r6]
	b .L111
.L111:
	b .L101
.L112:
	ldr r4, [fp, #-12]
	ldr r5, [fp, #-4]
	mov r6, #4
	mul r7, r5, r6
	add r5, r4, r7
	ldr r4, [r5]
	str r4, [fp, #-4]
	b .L111
.L113:
	ldr r4, [fp, #-16]
	ldr r5, [fp, #-8]
	cmp r5, #0
	mov r6, #4
	mul r7, r5, r6
	add r5, r4, r7
	ldr r4, [r5]
	ldr r5, [fp, #-16]
	ldr r6, [fp, #-4]
	cmp r6, #0
	mov r7, #4
	mul r8, r6, r7
	add r6, r5, r8
	ldr r5, [r6]
	cmp r4, r5
	beq .L110
	b .L139
.L114:
	add sp, sp, #16
	pop {r4, r5, r6, r7, r8, r9, r10, fp, lr}
	bx lr
.L115:
	add sp, sp, #16
	pop {r4, r5, r6, r7, r8, r9, r10, fp, lr}
	bx lr
.L116:
	b .L115
.L118:
	add sp, sp, #16
	pop {r4, r5, r6, r7, r8, r9, r10, fp, lr}
	bx lr
.L119:
	add sp, sp, #16
	pop {r4, r5, r6, r7, r8, r9, r10, fp, lr}
	bx lr
.L120:
	b .L119
.L122:
	add sp, sp, #16
	pop {r4, r5, r6, r7, r8, r9, r10, fp, lr}
	bx lr
.L123:
	add sp, sp, #16
	pop {r4, r5, r6, r7, r8, r9, r10, fp, lr}
	bx lr
.L124:
	b .L113
.L126:
	add sp, sp, #16
	pop {r4, r5, r6, r7, r8, r9, r10, fp, lr}
	bx lr
.L127:
	add sp, sp, #16
	pop {r4, r5, r6, r7, r8, r9, r10, fp, lr}
	bx lr
.L128:
	b .L127
.L132:
	add sp, sp, #16
	pop {r4, r5, r6, r7, r8, r9, r10, fp, lr}
	bx lr
.L133:
	add sp, sp, #16
	pop {r4, r5, r6, r7, r8, r9, r10, fp, lr}
	bx lr
.L134:
	b .L133
.L137:
	add sp, sp, #16
	pop {r4, r5, r6, r7, r8, r9, r10, fp, lr}
	bx lr
.L138:
	add sp, sp, #16
	pop {r4, r5, r6, r7, r8, r9, r10, fp, lr}
	bx lr
.L139:
	b .L112

	.global KMP
	.type KMP , %function
KMP:
	push {r4, r5, r6, r7, r8, r10, fp, lr}
	mov fp, sp
	ldr r4, =16400
	sub sp, sp, r4
.L143:
	ldr r10, =-16400
	str r0, [fp, r10]
	ldr r4, =-16396
	str r1, [fp, r4]
	ldr r5, =-16400
	ldr r4, [fp, r5]
	mov r5, #0
	ldr r6, =-16392
	mov r8, #4
	mul r7, r5, r8
	add r5, r6, r7
	add r6, fp, r5
	mov r0, r4
	mov r1, r6
	bl get_next
	ldr r4, =0
	str r4, [fp, #-8]
	ldr r4, =0
	str r4, [fp, #-4]
	b .L150
.L150:
	ldr r5, =-16396
	ldr r4, [fp, r5]
	ldr r5, [fp, #-4]
	cmp r5, #0
	mov r6, #4
	mul r7, r5, r6
	add r5, r4, r7
	ldr r4, [r5]
.L151:
	ldr r5, =-16400
	ldr r4, [fp, r5]
	ldr r5, [fp, #-8]
	cmp r5, #0
	mov r6, #4
	mul r7, r5, r6
	add r5, r4, r7
	ldr r4, [r5]
	ldr r6, =-16396
	ldr r5, [fp, r6]
	ldr r6, [fp, #-4]
	cmp r6, #0
	mov r7, #4
	mul r8, r6, r7
	add r6, r5, r8
	ldr r5, [r6]
	cmp r4, r5
	beq .L159
	b .L176
.L152:
	ldr r4, =0
	ldr r5, =1
	sub r6, r4, r5
	mov r0, r6
	ldr r1, =16400
	add sp, sp, r1
	pop {r4, r5, r6, r7, r8, r10, fp, lr}
	bx lr
.L155:
	mov r0, #0
	ldr r1, =16400
	add sp, sp, r1
	pop {r4, r5, r6, r7, r8, r10, fp, lr}
	bx lr
.L156:
	b .L155
.L159:
	ldr r4, [fp, #-8]
	ldr r5, =1
	add r6, r4, r5
	str r6, [fp, #-8]
	ldr r4, [fp, #-4]
	ldr r5, =1
	add r6, r4, r5
	str r6, [fp, #-4]
	ldr r5, =-16400
	ldr r4, [fp, r5]
	ldr r5, [fp, #-8]
	cmp r5, #0
	mov r6, #4
	mul r7, r5, r6
	add r5, r4, r7
	ldr r4, [r5]
	cmp r4, #0
	moveq r4, #1
	movne r4, #0
	cmp r4, #0
	bne .L177
	b .L188
.L160:
	b .L150
.L161:
	ldr r4, [fp, #-8]
	ldr r5, =-16392
	mov r6, #4
	mul r7, r4, r6
	add r4, r5, r7
	add r5, fp, r4
	ldr r4, [r5]
	str r4, [fp, #-8]
	ldr r4, [fp, #-8]
	cmp r4, #0
	ldr r5, =0
	ldr r6, =1
	sub r7, r5, r6
	cmp r7, #0
	cmp r4, r7
	beq .L191
	b .L203
.L164:
	mov r0, #0
	ldr r1, =16400
	add sp, sp, r1
	pop {r4, r5, r6, r7, r8, r10, fp, lr}
	bx lr
.L165:
	b .L164
.L170:
	mov r0, #0
	ldr r1, =16400
	add sp, sp, r1
	pop {r4, r5, r6, r7, r8, r10, fp, lr}
	bx lr
.L171:
	b .L170
.L176:
	b .L161
.L177:
	ldr r4, [fp, #-4]
	mov r0, r4
	ldr r1, =16400
	add sp, sp, r1
	pop {r4, r5, r6, r7, r8, r10, fp, lr}
	bx lr
	b .L178
.L178:
	b .L160
.L181:
	mov r0, #0
	ldr r1, =16400
	add sp, sp, r1
	pop {r4, r5, r6, r7, r8, r10, fp, lr}
	bx lr
.L182:
	b .L181
.L188:
	b .L178
.L191:
	ldr r4, [fp, #-8]
	ldr r5, =1
	add r6, r4, r5
	str r6, [fp, #-8]
	ldr r4, [fp, #-4]
	ldr r5, =1
	add r6, r4, r5
	str r6, [fp, #-4]
	b .L192
.L192:
	b .L160
.L194:
	mov r0, #0
	ldr r1, =16400
	add sp, sp, r1
	pop {r4, r5, r6, r7, r8, r10, fp, lr}
	bx lr
.L195:
	b .L194
.L198:
	mov r0, #0
	ldr r1, =16400
	add sp, sp, r1
	pop {r4, r5, r6, r7, r8, r10, fp, lr}
	bx lr
.L199:
	b .L198
.L203:
	b .L192

	.global read_str
	.type read_str , %function
read_str:
	push {r4, r5, r6, r7, r8, r10, fp, lr}
	mov fp, sp
	sub sp, sp, #8
.L204:
	str r0, [fp, #-8]
	ldr r10, =0
	str r10, [fp, #-4]
	b .L207
.L207:
	ldr r4, =1
	cmp r4, #0
	bne .L208
	b .L212
.L208:
	bl getch
	mov r4, r0
	ldr r5, [fp, #-8]
	ldr r6, [fp, #-4]
	mov r8, #4
	mul r7, r6, r8
	add r6, r5, r7
	str r4, [r6]
	ldr r4, [fp, #-8]
	ldr r5, [fp, #-4]
	cmp r5, #0
	mov r7, #4
	mul r6, r5, r7
	add r5, r4, r6
	ldr r4, [r5]
	cmp r4, #10
	beq .L215
	b .L225
.L209:
	ldr r4, [fp, #-8]
	ldr r5, [fp, #-4]
	mov r6, #4
	mul r7, r5, r6
	add r5, r4, r7
	ldr r4, =0
	str r4, [r5]
	ldr r4, [fp, #-4]
	mov r0, r4
	add sp, sp, #8
	pop {r4, r5, r6, r7, r8, r10, fp, lr}
	bx lr
.L212:
	b .L209
.L215:
	b .L209
.L216:
	ldr r4, [fp, #-4]
	ldr r5, =1
	add r6, r4, r5
	str r6, [fp, #-4]
	b .L207
.L219:
	mov r0, #0
	add sp, sp, #8
	pop {r4, r5, r6, r7, r8, r10, fp, lr}
	bx lr
.L220:
	b .L219
.L225:
	b .L216
.L226:
	b .L216

	.global main
	.type main , %function
main:
	push {r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov fp, sp
	ldr r4, =32768
	sub sp, sp, r4
.L228:
	mov r10, #0
	ldr r9, =-32768
	mov r7, #4
	mul r8, r10, r7
	add r4, r9, r8
	add r5, fp, r4
	mov r0, r5
	bl read_str
	mov r4, r0
	mov r4, #0
	ldr r5, =-16384
	mov r6, #4
	mul r7, r4, r6
	add r4, r5, r7
	add r5, fp, r4
	mov r0, r5
	bl read_str
	mov r4, r0
	mov r4, #0
	ldr r5, =-32768
	mov r6, #4
	mul r7, r4, r6
	add r4, r5, r7
	add r5, fp, r4
	mov r4, #0
	ldr r6, =-16384
	mov r7, #4
	mul r8, r4, r7
	add r4, r6, r8
	add r6, fp, r4
	mov r0, r5
	mov r1, r6
	bl KMP
	mov r4, r0
	mov r0, r4
	bl putint
	mov r0, #10
	bl putch
	mov r0, #0
	ldr r1, =32768
	add sp, sp, r1
	pop {r4, r5, r6, r7, r8, r9, r10, fp, lr}
	bx lr

